package cn.ztuo.bitrade.controller.member;

import cn.ztuo.bitrade.annotation.AccessLog;
import cn.ztuo.bitrade.constant.AdminModule;
import cn.ztuo.bitrade.constant.PageModel;
import cn.ztuo.bitrade.controller.common.BaseAdminController;
import cn.ztuo.bitrade.entity.RechargeRecord;
import cn.ztuo.bitrade.service.RechargeRecordService;
import cn.ztuo.bitrade.util.MessageResult;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/rechargeRecord")
public class RechargeRecordController extends BaseAdminController {

    @Autowired
    private RechargeRecordService rechargeRecordService;


    @RequiresPermissions("rechargeRecord:all")
    @PostMapping("all")
    @AccessLog(module = AdminModule.MEMBER, operation = "所有等级配置")
    public MessageResult all(PageModel pageModel, RechargeRecord rechargeRecord) {

        Page<RechargeRecord> all = rechargeRecordService.findAll(pageModel,rechargeRecord);

        return MessageResult.getSuccessInstance("请求成功", all);
    }


}